import 'package:flutter/material.dart';
import 'package:mjpeg_view/mjpeg_view.dart';


class FromFilePage extends StatefulWidget {
  FromFilePage({Key key}) : super(key: key);

  @override
  _FromFilePageState createState() => _FromFilePageState();
}

class _FromFilePageState extends State<FromFilePage> {
  List<MjpegController> controller;
  bool isLive = true;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) { 
      
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("MJPEG From File")),
      body: Center(
        child: null
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => this.setState(() => this.isLive = !this.isLive),
        tooltip: 'Pause',
        child: Icon(this.isLive ? Icons.pause: Icons.play_arrow)
      ),
    );
  }
}
